package com.ddyx.service.product.api.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;
import java.time.LocalDateTime;

/**
 * <p>
 * 商品信息变更日志
 * </p>
 *
 * @author agula
 * @since 2019-08-06
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
@TableName("p_goods_log")
public class GoodsLog extends Model<GoodsLog> {

    private static final long serialVersionUID=1L;

    /**
     * 商品信息日志ID
     */
    @TableId(value = "goods_log_id", type = IdType.AUTO)
    private Integer goodsLogId;

    /**
     * 商品ID
     */
    private Integer goodsId;

    /**
     * 日志类型,0：商品信息变更日志，1：库存进销存日志
     */
    private Integer logType;

    /**
     * 商品信息事件,0，商品属性更新，1：商品信息更新，2,商品价格更新
     */
    private Integer goodsEvent;

    /**
     * 事件操作状态,0:成功,1:失败
     */
    private Integer eventStatus;

    /**
     * 事件内容,JSON格式的字符串
     */
    private String eventContent;

    /**
     * 访问账号
     */
    private String fromUser;

    /**
     * 访问IP
     */
    private String fromIp;

    /**
     * 创建时间
     */
    private LocalDateTime gmtCreate;


    @Override
    protected Serializable pkVal() {
        return this.goodsLogId;
    }

    @Override
    public String toString() {
        return "GoodsLog{" +
        "goodsLogId=" + goodsLogId +
        ", goodsId=" + goodsId +
        ", logType=" + logType +
        ", goodsEvent=" + goodsEvent +
        ", eventStatus=" + eventStatus +
        ", eventContent=" + eventContent +
        ", fromUser=" + fromUser +
        ", fromIp=" + fromIp +
        ", gmtCreate=" + gmtCreate +
        "}";
    }
}
